/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * VerHorarioCompleto.java
 *
 * Created on 06/12/2012, 13:33:47
 */
package distribuicaoDeProfessores;


/**
 *
 * @author Jaime
 */
public class VerHorarioCompleto extends javax.swing.JPanel {
   
   
    /** Creates new form VerHorarioCompleto */
    public VerHorarioCompleto() {
        initComponents();
        
        
        //configurarImpressao();
        
    }

    
    void configurarImpressao(Horario horario){
       String texto = "";
       String linha = "";
            for (int j = 0; j < 7; j++)//Percorre os dias da semana
            {   
                texto+="____________________________________________________________________________________________\n";
                texto+="\n\t"+new Dia(j).getDia()+"\n";
                
                //javax.swing.JOptionPane.showMessageDialog(null, horario.getHorario().size());
                for( int i = 0; i < horario.getHorario().size(); i++)
                    if(horario.getHorario().get(i).getDia().getDia().equals(new Dia(j).getDia()))
                    {
                        texto+= horario.getHorario().get(i)+"\n";
                         //javax.swing.JOptionPane.showMessageDialog(null, horario.getHorario().get(i).getItemList().size());
                        for(int k=0; k < horario.getHorario().get(i).getItemList().size(); k++) 
                        {
                            ItensHorario item = horario.getHorario().get(i).getItem(k);
                        	
                                if(item.getProfessor() != null)
                        	linha = "\nPeriodo: " + item.getDisciplina().getPeriodo()    + 
                        					"\t Disciplina: "  + item.getDisciplina().getNome() + 
                        					"\t Professor: " + item.getProfessor().getNome()  +
                        					"\t Local: " + item.getLocal()+"\n\n";
                                else linha = "\nPeriodo: " + item.getDisciplina().getPeriodo()    + 
                        					"\t Disciplina: "  + item.getDisciplina().getNome() + 
                        					//"\t Professor: " + item.getProfessor().getNome()  +
                        					"\t Local: " + item.getLocal()+"\n\n";
                        	
                        	texto += linha;
                                linha="";
                        }  
                        texto+="\n\n";
                    }
                texto+="____________________________________________________________________________________________\n";
                exibirTexto.setText(texto);//Aparece o texto intermediario para cada dia da semana         
             }
        exibirTexto.setText(texto); //seta o texto completo.
    }                   
            
     /* initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        exibirTexto = new javax.swing.JTextArea();
        jLabel1 = new javax.swing.JLabel();

        setBackground(new java.awt.Color(204, 255, 255));
        setLayout(new java.awt.BorderLayout());

        exibirTexto.setBackground(new java.awt.Color(235, 255, 255));
        exibirTexto.setColumns(20);
        exibirTexto.setEditable(false);
        exibirTexto.setFont(new java.awt.Font("Arial", 1, 14));
        exibirTexto.setRows(5);
        jScrollPane1.setViewportView(exibirTexto);

        add(jScrollPane1, java.awt.BorderLayout.CENTER);

        jLabel1.setFont(new java.awt.Font("Script MT Bold", 0, 36));
        jLabel1.setText("Lista de Todos os Horários");
        jLabel1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED, new java.awt.Color(51, 0, 204), null, null, new java.awt.Color(51, 0, 204)));
        add(jLabel1, java.awt.BorderLayout.PAGE_START);
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextArea exibirTexto;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables
}
